# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-reader
pkgver=5.10.29
pkgrel=3
pkgdesc='A simple PDF reader, supporting bookmarks, highlights and annotations'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-reader"
license=('GPL3')
depends=('deepin-qt5integration' 'djvulibre' 'karchive' 'libchardet' 'libspectre' 'poppler-qt5'
         'qt5-webengine')
makedepends=('cmake' 'gtest' 'qt5-tools')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-reader/archive/$pkgver/$pkgname-$pkgver.tar.gz"
         openjpeg-2.5.patch)
sha512sums=('fd3c4fabd4195de0fce3c16a2efd3c44f2a43074b1ac97738cccada552c456779b61b503f1c2ca4c0fb7be7de4f7366aafe1a70523214ab4254f061e59997a30'
            '4ff8c063cc464a830cee8a5474329127c75f4298819f3384cb01d26cbcff38663eb89ff5ca69e1e800e28e509901c3671898c4dbda4b8426551b56c074af639b')

prepare() {
  cd deepin-reader-$pkgver
  patch -p1 -i ../openjpeg-2.5.patch # Fix build with openjpeg 2.5
}

build() {
  cd deepin-reader-$pkgver
  qmake-qt5 PREFIX=/usr
  make
}

package() {
  cd deepin-reader-$pkgver
  make INSTALL_ROOT="$pkgdir" install
}
